from rest_framework.generics import ListAPIView
from .models import BannerInfo, NavInfo
from .serializers import BannerInfoModelSerializer
from .serializers import NavInfoModelSerializer

# Create your views here.

class BannerInfoListAPIView(ListAPIView):
    '''轮播图列表'''
    queryset = BannerInfo.objects.filter(is_show=True, is_delete=False).order_by('orders')
    serializer_class = BannerInfoModelSerializer


class HeaderNavListAPIView(ListAPIView):
    '''头部导航列表'''
    queryset = NavInfo.objects.filter(is_show=True, is_delete=False, opt=1).order_by('orders')
    serializer_class = NavInfoModelSerializer


class FooterNavListAPIView(ListAPIView):
    '''脚部导航列表'''
    queryset = NavInfo.objects.filter(is_show=True, is_delete=False, opt=2).order_by('orders')
    serializer_class = NavInfoModelSerializer



